home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / Test::Harness.Z / Test::Harness
Encoding:
Text File  |  1998-10-28  |  6.2 KB  |  199 lines

  1.  
  2.  
  3.  
  4.      TTTTeeeesssstttt::::::::HHHHaaaarrrrnnnneeeessssssss((((3333)))) 4444////AAAAuuuugggg////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222)))) TTTTeeeesssstttt::::::::HHHHaaaarrrrnnnneeeessssssss((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       Test::Harness    - run perl standard test scripts with
  10.       statistics
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.       use Test::Harness;
  14.  
  15.       _r_u_n_t_e_s_t_s(@tests);
  16.  
  17.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.       (By using the    the _T_e_s_t manpage module, you can write test
  19.       scripts without knowing the exact output this    module
  20.       expects.  However, if    you need to know the specifics,    read
  21.       on!)
  22.  
  23.       Perl test scripts print to standard output "ok N" for    each
  24.       single test, where N is an increasing    sequence of integers.
  25.       The first line output    by a standard test script is "1..M"
  26.       with M being the number of tests that    should be run within
  27.       the test script. _T_e_s_t::_H_a_r_n_e_s_s::_r_u_n_t_e_s_t_s(@tests) runs    all
  28.       the testscripts named    as arguments and checks    standard
  29.       output for the expected "ok N" strings.
  30.  
  31.       After    all tests have been performed, _r_u_n_t_e_s_t_s() prints some
  32.       performance statistics that are computed by the Benchmark
  33.       module.
  34.  
  35.       TTTThhhheeee tttteeeesssstttt ssssccccrrrriiiipppptttt oooouuuuttttppppuuuutttt
  36.  
  37.       Any output from the testscript to standard error is ignored
  38.       and bypassed,    thus will be seen by the user. Lines written
  39.       to standard output containing    /^(not\s+)?ok\b/ are
  40.       interpreted as feedback for _r_u_n_t_e_s_t_s().  All other lines are
  41.       discarded.
  42.  
  43.       It is    tolerated if the test numbers after ok are omitted. In
  44.       this case Test::Harness maintains temporarily    its own
  45.       counter until    the script supplies test numbers again.    So the
  46.       following test script
  47.  
  48.           print <<END;
  49.           1..6
  50.           not ok
  51.           ok
  52.           not ok
  53.           ok
  54.           ok
  55.           END
  56.  
  57.       will generate
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      TTTTeeeesssstttt::::::::HHHHaaaarrrrnnnneeeessssssss((((3333)))) 4444////AAAAuuuugggg////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222)))) TTTTeeeesssstttt::::::::HHHHaaaarrrrnnnneeeessssssss((((3333))))
  71.  
  72.  
  73.  
  74.           FAILED tests 1, 3, 6
  75.           Failed 3/6 tests,    50.00% okay
  76.  
  77.       The global variable $Test::Harness::verbose is exportable
  78.       and can be used to let _r_u_n_t_e_s_t_s() display the    standard
  79.       output of the    script without altering    the behavior
  80.       otherwise.
  81.  
  82.       The global variable $Test::Harness::switches is exportable
  83.       and can be used to set perl command line options used    for
  84.       running the test _s_c_r_i_p_t(s). The default value    is -w.
  85.  
  86.       If the standard output line contains substring  # Skip (with
  87.       variations in    spacing    and case) after    ok or ok NUMBER, it is
  88.       counted as a skipped test.  If the whole testscript
  89.       succeeds, the    count of skipped tests is included in the
  90.       generated output.
  91.  
  92.      EEEEXXXXPPPPOOOORRRRTTTT
  93.       &runtests is exported    by Test::Harness per default.
  94.  
  95.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  96.       All tests successful.\nFiles=%d,  Tests=%d, %s
  97.           If all tests are successful some statistics about    the
  98.           performance are printed.
  99.  
  100.       FAILED tests %s\n\tFailed %d/%d tests, %.2f%%    okay.
  101.           For any single script that has failing subtests
  102.           statistics like the above    are printed.
  103.  
  104.       Test returned    status %d (wstat %d)
  105.           Scripts that return a non-zero exit status, both $? >> 8
  106.           and $? are printed in a message similar to the above.
  107.  
  108.       Failed 1 test, %.2f%%    okay. %s
  109.  
  110.       Failed %d/%d tests, %.2f%% okay. %s
  111.           If not all tests were successful,    the script dies    with
  112.           one of the above messages.
  113.  
  114.      EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
  115.       Setting HARNESS_IGNORE_EXITCODE makes    harness    ignore the
  116.       exit status of child processes.
  117.  
  118.       If HARNESS_FILELEAK_IN_DIR is    set to the name    of a
  119.       directory, harness will check    after each test    whether    new
  120.       files    appeared in that directory, and    report them as
  121.  
  122.         LEAKED FILES: scr.tmp 0 my.db
  123.  
  124.       If relative, directory name is with respect to the current
  125.       directory at the moment _r_u_n_t_e_s_t_s() was called.  Putting
  126.  
  127.  
  128.  
  129.      Page 2                        (printed 10/23/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      TTTTeeeesssstttt::::::::HHHHaaaarrrrnnnneeeessssssss((((3333)))) 4444////AAAAuuuugggg////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222)))) TTTTeeeesssstttt::::::::HHHHaaaarrrrnnnneeeessssssss((((3333))))
  137.  
  138.  
  139.  
  140.       absolute path    into HARNESS_FILELEAK_IN_DIR may give more
  141.       predicatable results.
  142.  
  143.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  144.       the _T_e_s_t manpage for writing test scripts and    also the
  145.       _B_e_n_c_h_m_a_r_k manpage for    the underlying timing routines.
  146.  
  147.      AAAAUUUUTTTTHHHHOOOORRRRSSSS
  148.       Either Tim Bunce or Andreas Koenig, we don't know. What we
  149.       know for sure    is, that it was    inspired by Larry Wall's TEST
  150.       script that came with    perl distributions for ages. Numerous
  151.       anonymous contributors exist.    Current    maintainer is Andreas
  152.       Koenig.
  153.  
  154.      BBBBUUUUGGGGSSSS
  155.       Test::Harness    uses $^X to determine the perl binary to run
  156.       the tests with. Test scripts running via the shebang (#!)
  157.       line may not be portable because $^X is not consistent for
  158.       shebang scripts across platforms. This is no problem when
  159.       Test::Harness    is run with an absolute    path to    the perl
  160.       binary or when $^X can be found in the path.
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                        (printed 10/23/98)
  196.  
  197.  
  198.  
  199.